/**
 * 引擎入口;
 */
import {Room1} from './Scenes/Room1';
import {Menu} from './Scenes/Menu';
import {Demo1} from './Scenes/Demo1';
import {Demo3} from './Scenes/Demo3';
import {GlobalVariables} from 'GlobalVariables';
export var global = new GlobalVariables();
global.checkIfSuccess();    //如果初始化不成功会抛出错误
/**-----------场景在此初始化------------ */
new Menu();
new Demo1();
// new Demo2();
new Demo3();
// new MainScene();
new Room1();
/**------------------------------------ */

/**------------第一个场景-------------- */
global.askForRender(SCENE.Menu);

var renderLoop = () => {
    if (global.sceneOnRender != null) {
        global.scenesInitialed[global.sceneOnRender].scene.render();
    }
};
global.engine.runRenderLoop(renderLoop);

// Resize
window.addEventListener("resize", function () {
    global.engine.resize();
});